.class public Lcom/example/m6shop/PhoneImgActivity;
.super Landroid/app/Activity;
.source "PhoneImgActivity.java"


# static fields
.field public static me:Lcom/example/m6shop/PhoneImgActivity;


# instance fields
.field private imageView:Landroid/widget/ImageView;

.field private imgViewListener:Landroid/view/View$OnClickListener;

.field m:Lmyapp/MyApp;

.field private mContent:[B

.field private mcontext:Landroid/content/Context;

.field myBitmap:Landroid/graphics/Bitmap;

.field picPath:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    const/4 v0, 0x0

    .line 43
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    .line 48
    iput-object v0, p0, Lcom/example/m6shop/PhoneImgActivity;->picPath:Ljava/lang/String;

    .line 49
    iput-object v0, p0, Lcom/example/m6shop/PhoneImgActivity;->m:Lmyapp/MyApp;

    .line 43
    return-void
.end method

.method public static getPicFromBytes([BLandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
    .locals 2
    .param p0, "bytes"    # [B
    .param p1, "opts"    # Landroid/graphics/BitmapFactory$Options;

    .prologue
    const/4 v1, 0x0

    .line 336
    if-eqz p0, :cond_1

    .line 337
    if-eqz p1, :cond_0

    .line 338
    array-length v0, p0

    invoke-static {p0, v1, v0, p1}, Landroid/graphics/BitmapFactory;->decodeByteArray([BIILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 341
    :goto_0
    return-object v0

    .line 340
    :cond_0
    array-length v0, p0

    invoke-static {p0, v1, v0}, Landroid/graphics/BitmapFactory;->decodeByteArray([BII)Landroid/graphics/Bitmap;

    move-result-object v0

    goto :goto_0

    .line 341
    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public static readStream(Ljava/io/InputStream;)[B
    .locals 5
    .param p0, "inStream"    # Ljava/io/InputStream;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .prologue
    .line 345
    const/16 v4, 0x400

    new-array v0, v4, [B

    .line 346
    .local v0, "buffer":[B
    const/4 v2, -0x1

    .line 347
    .local v2, "len":I
    new-instance v3, Ljava/io/ByteArrayOutputStream;

    invoke-direct {v3}, Ljava/io/ByteArrayOutputStream;-><init>()V

    .line 348
    .local v3, "outStream":Ljava/io/ByteArrayOutputStream;
    :goto_0
    invoke-virtual {p0, v0}, Ljava/io/InputStream;->read([B)I

    move-result v2

    const/4 v4, -0x1

    if-ne v2, v4, :cond_0

    .line 351
    invoke-virtual {v3}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B

    move-result-object v1

    .line 352
    .local v1, "data":[B
    invoke-virtual {v3}, Ljava/io/ByteArrayOutputStream;->close()V

    .line 353
    invoke-virtual {p0}, Ljava/io/InputStream;->close()V

    .line 354
    return-object v1

    .line 349
    .end local v1    # "data":[B
    :cond_0
    const/4 v4, 0x0

    invoke-virtual {v3, v0, v4, v2}, Ljava/io/ByteArrayOutputStream;->write([BII)V

    goto :goto_0
.end method

.method private uploadFile()V
    .locals 1

    .prologue
    .line 252
    new-instance v0, Lcom/example/m6shop/PhoneImgActivity$4;

    invoke-direct {v0, p0}, Lcom/example/m6shop/PhoneImgActivity$4;-><init>(Lcom/example/m6shop/PhoneImgActivity;)V

    .line 322
    invoke-virtual {v0}, Lcom/example/m6shop/PhoneImgActivity$4;->start()V

    .line 323
    return-void
.end method

.method private uploadFile2Svr2()Z
    .locals 1

    .prologue
    .line 207
    new-instance v0, Lcom/example/m6shop/PhoneImgActivity$3;

    invoke-direct {v0, p0}, Lcom/example/m6shop/PhoneImgActivity$3;-><init>(Lcom/example/m6shop/PhoneImgActivity;)V

    .line 247
    invoke-virtual {v0}, Lcom/example/m6shop/PhoneImgActivity$3;->start()V

    .line 248
    const/4 v0, 0x0

    return v0
.end method


# virtual methods
.method public getFileName(Ljava/lang/String;)Ljava/lang/String;
    .locals 4
    .param p1, "pathandname"    # Ljava/lang/String;

    .prologue
    const/4 v3, -0x1

    .line 326
    const-string v2, "/"

    invoke-virtual {p1, v2}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v1

    .line 327
    .local v1, "start":I
    const-string v2, "."

    invoke-virtual {p1, v2}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v0

    .line 328
    .local v0, "end":I
    if-eq v1, v3, :cond_0

    if-eq v0, v3, :cond_0

    .line 329
    add-int/lit8 v2, v1, 0x1

    invoke-virtual {p1, v2, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v2

    .line 331
    :goto_0
    return-object v2

    :cond_0
    const/4 v2, 0x0

    goto :goto_0
.end method

.method protected onActivityResult(IILandroid/content/Intent;)V
    .locals 13
    .param p1, "requestCode"    # I
    .param p2, "resultCode"    # I
    .param p3, "data"    # Landroid/content/Intent;

    .prologue
    .line 105
    invoke-virtual {p0}, Lcom/example/m6shop/PhoneImgActivity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v11

    .line 111
    .local v11, "resolver":Landroid/content/ContentResolver;
    sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "\u9009\u62e9\u56fe\u7247\u7ed3\u679c:"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

    .line 112
    if-nez p1, :cond_2

    .line 115
    if-eqz p3, :cond_1

    .line 118
    :try_start_0
    invoke-virtual/range {p3 .. p3}, Landroid/content/Intent;->getData()Landroid/net/Uri;

    move-result-object v1

    .line 121
    .local v1, "originalUri":Landroid/net/Uri;
    const/4 v0, 0x1

    new-array v2, v0, [Ljava/lang/String;

    const/4 v0, 0x0

    const-string v3, "_data"

    aput-object v3, v2, v0

    .line 122
    .local v2, "pojo":[Ljava/lang/String;
    const/4 v3, 0x0

    const/4 v4, 0x0

    const/4 v5, 0x0

    move-object v0, p0

    invoke-virtual/range {v0 .. v5}, Lcom/example/m6shop/PhoneImgActivity;->managedQuery(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v8

    .line 124
    .local v8, "cursor":Landroid/database/Cursor;
    if-eqz v8, :cond_0

    .line 126
    const/4 v0, 0x0

    aget-object v0, v2, v0

    invoke-interface {v8, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v7

    .line 127
    .local v7, "columnIndex":I
    invoke-interface {v8}, Landroid/database/Cursor;->moveToFirst()Z

    .line 128
    invoke-interface {v8, v7}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/example/m6shop/PhoneImgActivity;->picPath:Ljava/lang/String;

    .line 129
    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v3, 0xe

    if-ge v0, v3, :cond_0

    .line 130
    invoke-interface {v8}, Landroid/database/Cursor;->close()V

    .line 134
    .end local v7    # "columnIndex":I
    :cond_0
    sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "\u9009\u62e9\u56fe\u7247\u8def\u5f84:"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v4, p0, Lcom/example/m6shop/PhoneImgActivity;->picPath:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

    .line 136
    invoke-virtual {v1}, Landroid/net/Uri;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v0

    invoke-virtual {v11, v0}, Landroid/content/ContentResolver;->openInputStream(Landroid/net/Uri;)Ljava/io/InputStream;

    move-result-object v0

    invoke-static {v0}, Lcom/example/m6shop/PhoneImgActivity;->readStream(Ljava/io/InputStream;)[B

    move-result-object v0

    iput-object v0, p0, Lcom/example/m6shop/PhoneImgActivity;->mContent:[B

    .line 138
    iget-object v0, p0, Lcom/example/m6shop/PhoneImgActivity;->mContent:[B

    const/4 v3, 0x0

    invoke-static {v0, v3}, Lcom/example/m6shop/PhoneImgActivity;->getPicFromBytes([BLandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object v0

    iput-object v0, p0, Lcom/example/m6shop/PhoneImgActivity;->myBitmap:Landroid/graphics/Bitmap;

    .line 140
    iget-object v0, p0, Lcom/example/m6shop/PhoneImgActivity;->imageView:Landroid/widget/ImageView;

    iget-object v3, p0, Lcom/example/m6shop/PhoneImgActivity;->myBitmap:Landroid/graphics/Bitmap;

    invoke-virtual {v0, v3}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 205
    .end local v1    # "originalUri":Landroid/net/Uri;
    .end local v2    # "pojo":[Ljava/lang/String;
    .end local v8    # "cursor":Landroid/database/Cursor;
    :cond_1
    :goto_0
    return-void

    .line 142
    :catch_0
    move-exception v9

    .line 143
    .local v9, "e":Ljava/lang/Exception;
    sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;

    invoke-virtual {v9}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

    goto :goto_0

    .line 146
    .end local v9    # "e":Ljava/lang/Exception;
    :cond_2
    const/4 v0, 0x1

    if-ne p1, v0, :cond_1

    .line 148
    :try_start_1
    invoke-super/range {p0 .. p3}, Landroid/app/Activity;->onActivityResult(IILandroid/content/Intent;)V

    .line 173
    new-instance v12, Landroid/content/ContentValues;

    invoke-direct {v12}, Landroid/content/ContentValues;-><init>()V

    .line 174
    .local v12, "values":Landroid/content/ContentValues;
    invoke-virtual {p0}, Lcom/example/m6shop/PhoneImgActivity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    sget-object v3, Landroid/provider/MediaStore$Images$Media;->EXTERNAL_CONTENT_URI:Landroid/net/Uri;

    invoke-virtual {v0, v3, v12}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;

    move-result-object v1

    .line 175
    .restart local v1    # "originalUri":Landroid/net/Uri;
    const/4 v0, 0x1

    new-array v2, v0, [Ljava/lang/String;

    const/4 v0, 0x0

    const-string v3, "_data"

    aput-object v3, v2, v0

    .line 176
    .restart local v2    # "pojo":[Ljava/lang/String;
    const/4 v3, 0x0

    const/4 v4, 0x0

    const/4 v5, 0x0

    move-object v0, p0

    invoke-virtual/range {v0 .. v5}, Lcom/example/m6shop/PhoneImgActivity;->managedQuery(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v8

    .line 178
    .restart local v8    # "cursor":Landroid/database/Cursor;
    if-eqz v8, :cond_3

    .line 180
    const/4 v0, 0x0

    aget-object v0, v2, v0

    invoke-interface {v8, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v7

    .line 181
    .restart local v7    # "columnIndex":I
    invoke-interface {v8}, Landroid/database/Cursor;->moveToFirst()Z

    .line 182
    invoke-interface {v8, v7}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/example/m6shop/PhoneImgActivity;->picPath:Ljava/lang/String;

    .line 183
    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v3, 0xe

    if-ge v0, v3, :cond_3

    .line 184
    invoke-interface {v8}, Landroid/database/Cursor;->close()V

    .line 188
    .end local v7    # "columnIndex":I
    :cond_3
    sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "\u9009\u62e9\u76f8\u7247\u8def\u5f84:"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v4, p0, Lcom/example/m6shop/PhoneImgActivity;->picPath:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

    .line 191
    invoke-virtual/range {p3 .. p3}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v10

    .line 192
    .local v10, "extras":Landroid/os/Bundle;
    const-string v0, "data"

    invoke-virtual {v10, v0}, Landroid/os/Bundle;->get(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/graphics/Bitmap;

    iput-object v0, p0, Lcom/example/m6shop/PhoneImgActivity;->myBitmap:Landroid/graphics/Bitmap;

    .line 193
    new-instance v6, Ljava/io/ByteArrayOutputStream;

    invoke-direct {v6}, Ljava/io/ByteArrayOutputStream;-><init>()V

    .line 194
    .local v6, "baos":Ljava/io/ByteArrayOutputStream;
    iget-object v0, p0, Lcom/example/m6shop/PhoneImgActivity;->myBitmap:Landroid/graphics/Bitmap;

    sget-object v3, Landroid/graphics/Bitmap$CompressFormat;->JPEG:Landroid/graphics/Bitmap$CompressFormat;

    const/16 v4, 0x64

    invoke-virtual {v0, v3, v4, v6}, Landroid/graphics/Bitmap;->compress(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z

    .line 195
    invoke-virtual {v6}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B

    move-result-object v0

    iput-object v0, p0, Lcom/example/m6shop/PhoneImgActivity;->mContent:[B

    .line 196
    iget-object v0, p0, Lcom/example/m6shop/PhoneImgActivity;->imageView:Landroid/widget/ImageView;

    iget-object v3, p0, Lcom/example/m6shop/PhoneImgActivity;->myBitmap:Landroid/graphics/Bitmap;

    invoke-virtual {v0, v3}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    goto/16 :goto_0

    .line 197
    .end local v1    # "originalUri":Landroid/net/Uri;
    .end local v2    # "pojo":[Ljava/lang/String;
    .end local v6    # "baos":Ljava/io/ByteArrayOutputStream;
    .end local v8    # "cursor":Landroid/database/Cursor;
    .end local v10    # "extras":Landroid/os/Bundle;
    .end local v12    # "values":Landroid/content/ContentValues;
    :catch_1
    move-exception v9

    .line 199
    .restart local v9    # "e":Ljava/lang/Exception;
    invoke-virtual {v9}, Ljava/lang/Exception;->printStackTrace()V

    goto/16 :goto_0
.end method

.method public onCreate(Landroid/os/Bundle;)V
    .locals 4
    .param p1, "savedInstanceState"    # Landroid/os/Bundle;

    .prologue
    .line 54
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 55
    const v2, 0x7f030026

    invoke-virtual {p0, v2}, Lcom/example/m6shop/PhoneImgActivity;->setContentView(I)V

    .line 57
    invoke-virtual {p0}, Lcom/example/m6shop/PhoneImgActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v2

    check-cast v2, Lmyapp/MyApp;

    iput-object v2, p0, Lcom/example/m6shop/PhoneImgActivity;->m:Lmyapp/MyApp;

    .line 58
    iget-object v2, p0, Lcom/example/m6shop/PhoneImgActivity;->m:Lmyapp/MyApp;

    invoke-virtual {v2}, Lmyapp/MyApp;->getActivity()Ljava/util/ArrayList;

    move-result-object v0

    .line 59
    .local v0, "activityList":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/app/Activity;>;"
    invoke-virtual {v0, p0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 61
    iput-object p0, p0, Lcom/example/m6shop/PhoneImgActivity;->mcontext:Landroid/content/Context;

    .line 62
    sput-object p0, Lcom/example/m6shop/PhoneImgActivity;->me:Lcom/example/m6shop/PhoneImgActivity;

    .line 63
    const v2, 0x7f070102

    invoke-virtual {p0, v2}, Lcom/example/m6shop/PhoneImgActivity;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/ImageView;

    iput-object v2, p0, Lcom/example/m6shop/PhoneImgActivity;->imageView:Landroid/widget/ImageView;

    .line 65
    new-instance v2, Lcom/example/m6shop/PhoneImgActivity$1;

    invoke-direct {v2, p0}, Lcom/example/m6shop/PhoneImgActivity$1;-><init>(Lcom/example/m6shop/PhoneImgActivity;)V

    iput-object v2, p0, Lcom/example/m6shop/PhoneImgActivity;->imgViewListener:Landroid/view/View$OnClickListener;

    .line 89
    iget-object v2, p0, Lcom/example/m6shop/PhoneImgActivity;->imageView:Landroid/widget/ImageView;

    iget-object v3, p0, Lcom/example/m6shop/PhoneImgActivity;->imgViewListener:Landroid/view/View$OnClickListener;

    invoke-virtual {v2, v3}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 91
    const v2, 0x7f07000a

    invoke-virtual {p0, v2}, Lcom/example/m6shop/PhoneImgActivity;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/Button;

    .line 92
    .local v1, "menu_collectlist":Landroid/widget/Button;
    new-instance v2, Lcom/example/m6shop/PhoneImgActivity$2;

    invoke-direct {v2, p0}, Lcom/example/m6shop/PhoneImgActivity$2;-><init>(Lcom/example/m6shop/PhoneImgActivity;)V

    invoke-virtual {v1, v2}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 101
    return-void
.end method
